package com.andyliu.configer;

import com.andyliu.interceptor.TokenInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * ClassName: WebConfiger
 * Description: TODO
 * date: 2021/8/10 5:24 下午
 *
 * @author andyliu
 * @qq 115176513
 * @since JDK 1.8
 */
@Configuration
public class WebConfiger implements WebMvcConfigurer {
    @Autowired
    private TokenInterceptor interceptor;
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(interceptor).addPathPatterns("/**").excludePathPatterns("/login")
        .excludePathPatterns("/index.html")
        .excludePathPatterns("/web/**")
        .excludePathPatterns("/webjars/**")
        .excludePathPatterns("*.js");
    }



}
